package com.edmendst.xmall.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
public class DeliveryInfo {
    //  1: 添加
    @JsonProperty("opcode")
    private Integer opcode;
    @JsonProperty("addressId")
    private Long addressId;

    @JsonProperty("receiver")
    private String receiver;
    @JsonProperty("mobile")
    private String mobile;
    @JsonProperty("region")
    private Region region;
    @JsonProperty("detail")
    private String detail;

    private Boolean defaultAddress;

    public DeliveryInfo(
    ){

    }

    public DeliveryInfo(Long addressId, String receiver, String mobile,
                        Region region, String detail, Boolean defaultAddress) {
        this.addressId = addressId;
        this.receiver = receiver;
        this.mobile = mobile;
        this.region = region;
        this.detail = detail;
        this.defaultAddress = defaultAddress;
    }


    @Override
    public String toString() {
        return "DeliveryInfo{" +
                "receiver='" + receiver + '\'' +
                ", mobile=" + mobile +
                ", region=" + region +
                ", detail='" + detail + '\'' +
                '}';
    }
}
